Component({
    properties: {},
    data: {},
    methods: {
        toggle: function(s) {
            var t, o = "";
            switch (s.currentTarget.dataset.idx) {
              case 1:
                this.setData({
                    hascolor: 1
                }), "1_2" == this.data.colorshow ? (this.setData({
                    colorshow: "1_1"
                }), t = "comment_num", o = "asc") : (this.setData({
                    colorshow: "1_2"
                }), t = "comment_num", o = "desc");
                break;

              case 2:
                this.setData({
                    hascolor: 2
                }), "2_2" == this.data.colorshow ? (this.setData({
                    colorshow: "2_1"
                }), t = "show_sales", o = "asc") : (this.setData({
                    colorshow: "2_2"
                }), t = "show_sales", o = "desc");
                break;

              case 3:
                this.setData({
                    hascolor: 3
                }), "3_2" == this.data.colorshow ? (this.setData({
                    colorshow: "3_1"
                }), t = "min_price", o = "asc") : (this.setData({
                    colorshow: "3_2"
                }), t = "max_price", o = "desc");
            }
            this.triggerEvent("sortIn", {
                order_field: t,
                order_by: o
            });
        },
        init: function() {
            this.setData({
                colorshow: "",
                hascolor: ""
            });
        },
        showbox: function() {
            this.triggerEvent("showscreen", {});
        }
    }
});